
$(function() {

	$("input[id^='name_s']:visible").autocomplete(Test.emp_name);
	
	$("input[id^='dept_s']:visible").autocomplete(Test.dept);
});

function chkbox(form) {
	var len = form.elements.length;
	for ( var i = 0; i < len; i++) {
		var e = form.elements[i];
		if (e.name != 'chkall') {
			e.checked = form.chkall.checked;
		}
	}
}

var Address = {
	download: function (photo) {
		
		var url = 'emp.php?do=Address.vcf&batch=batch&photo=' + photo;
		var c = new Array();
		$("input[name^='c_']").each(function() {
			if ($(this).attr("checked")) {
				var s = encodeURIComponent(this.name) + "=" + encodeURIComponent($(this).val());
				c.push(s);
			}
		});
		
		var cc = c.join("&");
		
		var s = url + "&" + cc;
		
		jswin(s, 'jswin', '1024x768');
	},

	foxmail: function () {
		var url = 'emp.php?do=Address.foxmail&batch=batch';
		var c = new Array();
		$("input[name^='c_']").each(function() {
			if ($(this).attr("checked")) {
				var s = encodeURIComponent(this.name) + "=" + encodeURIComponent($(this).val());
				c.push(s);
			}
		});
		
		var cc = c.join("&");
		
		var s = url + "&" + cc;
		
		jswin(s, 'jswin', '1024x768');
	}
}
